c# find item in list

37

find a value in list of objects in c# -

var item = TextPool.FirstOrDefault(o => o.Name == "test");
if (item != null)
       item.value = "Value";

c# find item in list -

MyClass result = list.Find(x => x.GetId() == "xy");

c# find element in list of list -

var element = (from sublist in userList
               from item in sublist
               where item.uniqueidentifier == someid
               select item).FirstOrDefault();

Comments

Submit
0 Comments